package com.bm.bookmanagement.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration//表明当前类是配置类
public class SwaggerConfig {

    //    //构建 api文档的详细信息
    @Bean
    public OpenAPI apiInfo() {
        return new OpenAPI()
                .info(new Info()
                        .title("lxc-图书管理系统")
                        .description("这是一个图书管理系统的接口文档，由springdoc生成")
                        .version("v1.0.0")
                        .license(new License()
                                .name("许可协议")
                                .url("http://127.0.0.1:8080"))
                        .contact(new Contact()
                                .name("林先成")
                                .email("linxiancheng@163.com")))
                .externalDocs(new ExternalDocumentation()
                        .description("gitee")
                        .url("git地址"));
    }

}